package com.exam.pinduoduo;

import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution001 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); ) {
            int start = i;
            char cur = str.charAt(i++);
            while(i < str.length() && str.charAt(i) == cur){
                i++;
            }
            int len = i - start;
            sb.append(len).append(cur);
        }
        System.out.println(sb.toString());
    }
}
